package com.xdtech.hotel.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.hotel.model.DeviceLink;
import com.xdtech.hotel.model.RoomConfig;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-04-04 11:42:14
 * @since 1.0
 * @see
 */
public class RoomConfigItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="房间类型",width=100)
	private String roomType;
	@GridColumn(title="配置信息",width=100)
	private String configInfo;
	
	private String configXml;
	
	private List<DeviceLinkItem> deviceLinks = new ArrayList<DeviceLinkItem>();

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	public void setRoomType(String roomType) {
		this.roomType = roomType;
	}
	public String getRoomType() {
		return roomType;
	}
	
	public void setConfigInfo(String configInfo) {
		this.configInfo = configInfo;
	}
	public String getConfigInfo() {
		return configInfo;
	}
	
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static RoomConfigItem createItem(RoomConfig roomConfig) {
		RoomConfigItem roomConfigItem = new RoomConfigItem();
		BeanUtils.copyProperties(roomConfigItem, roomConfig);
		//自定义属性设置填充
		return roomConfigItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<RoomConfigItem> createItems(List<RoomConfig> roomConfigs) {
		List<RoomConfigItem> roomConfigItems = new ArrayList<RoomConfigItem>();
		for (RoomConfig roomConfig : roomConfigs) {
			roomConfigItems.add(createItem(roomConfig));
		}
		return roomConfigItems;
	}
	public String getConfigXml() {
		return configXml;
	}
	public void setConfigXml(String configXml) {
		this.configXml = configXml;
	}
	public List<DeviceLinkItem> getDeviceLinks() {
		return deviceLinks;
	}
	public void setDeviceLinks(List<DeviceLinkItem> deviceLinks) {
		this.deviceLinks = deviceLinks;
	}
}
